<!-----------实名认证成功页面(继续充值)------------->
<template>
  <div>
    <topheader :toptitle="toptitle"/>
    <div class="wrapper">
      <div class="wrapper-inner">
        <img class="realname-bind-success" src="static/img/success2.png"/>
        <p class="bind-tip tc">太棒啦！实名认证成功~</p>
        <div class="btn btn-normalsize btn-bluebg btn-bind" @click="continueCharge" v-if="flag">继续充值</div>
      </div>
    </div>
  </div>
</template>

<script> 
	import Vue from "vue"
	import topheader from '@/components/topheader'
  import apiConfig from '../config/api.js'
	import Message from "iview/src/components/message"


	Vue.prototype.$Message = Message
  export default {
    name: 'certify',
    components: {
      'topheader': topheader
    },
    data() {
      return {
        toptitle: "实名认证",
        flag: false
      }
    },
    created () {
      if (this.$route.params.flag == "show") {
        this.flag = true
      }
    },
    methods: {
      continueCharge: function () {
         //请求参数
				let params = {
		        appid: userInfoKit.appid,
		        token: userInfoKit.getUserInfo().token,
		        productId:"100000012",
		        mchOrderId:"2019032220029",
		        productName:"笑傲江湖游戏货币",
		        amount:"1.00",
		        roleName:"张无忌",
		        extra:"2019032220029",
		        serverId:1001,	//区服ID
		        gameUrl:"https://www.baidu.com",
		        isDev:0,
		        //sign:"3891e207d2f1899839ea52247f5c1aac"
		    }
		    // 请求收银台接口
		    this.$http(
	    	{
	           method: "GET",
	           url: apiConfig.app.user.getPayUrl,
	           params: params,
	           emulateJSON: true
	    	}).then(function (resp) {
	    	  //debugger
		    	if (resp.body.code == "200") {
		        	// 成功后跳转到收银台页面
		        	this.$router.push({name: "recharge", params: {
		        				productName: resp.body.data.productName,
		        				amount: resp.body.data.amount,
		        				alipay: resp.body.data.alipay
		        			}
		        	});
		    	} else{	    		
						this.$Message.warning(resp.body.msg)
		    	}
	    	})
      }
      
    }
  }
</script>

